<template>
  <Table class="default" filter v-bind="tableOpts" v-on="tableEvent">
    <template #operator>
      <div class="operator-wrap">
        <modifyWarehouse ref="dialogRef" @change="fetchCurrentTable" />
      </div>
    </template>
  </Table>
</template>

<script>
import dayjs from "dayjs";
import modifyWarehouse from "./components/modifyWarehouse.vue";
import tableMixins from "@/mixins/tableMixins.vue";
export default {
  name: "WarehouseList",
  mixins: [tableMixins],
  components: { modifyWarehouse },
  meta: { title: "仓库列表", icon: "el-icon-s-cooperation", sort: 13,authority: 110 },
  data() {
    return {
      apiName: "warehouseWarehouseList",
      form: {
        warehouseName: {
          tag: "el-input",
          label: "仓库名称",
          value: "",
          props: {
            clearable: true,
            placeholder: "请输入仓库名称",
          },
        },
      },
    };
  },
  methods: {
    handleAction(opts, row) {
      const { warehouseName: name, warehouseId } = row;
      if (["edit"].includes(opts)) this.showDialog(opts, row);
      else if (opts === "delete")
        this.showConfirm(`确认删除【${name}】？`, "warehouseWarehouseDelete", {
          warehouseId,
        });
      else {
        const ref = this.$refs[opts];
        ref && ref.showDialog(opts, row);
      }
    },
  },
};
</script>

<style lang="less" scoped>

.default /deep/ .el-button--primary {
  border-color: #ff6a00;
  background-color: #ff6a00;
}

.default /deep/ .el-button:hover {
  color: white;
  border-color: #f59a59;
  background-color: #f59a59;
}
.default /deep/ .el-button:active{
  color: white;
  border-color: #f59a59;
  background-color: #f59a59;
}
.default /deep/ .el-button:focus{
  color: #ff6a00;
  border-color: #fdf2e9;
  background-color:#fdf2e9;
}

/deep/ .el-input__inner:hover{
  border-color: #ff6a00 !important;
}
/deep/ .el-input__inner:focus{
  border-color: #ff6a00 !important;
}
/deep/ .selected{
  color:#ff6a00 !important;
}
/deep/ .active{
  color:#ff6a00 !important;
}
/deep/ .selected{
  color:#ff6a00 !important;
}
/deep/ .el-loading-text{
  color:#ff6a00 !important;
}
/deep/ .el-icon-loading{
  color:#ff6a00 !important;
}
</style>
